/*
 * @Author: Easycome 2684545336@qq.com
 * @Date: 2025-01-18 01:02:46
 * @LastEditors: Easycome 2684545336@qq.com
 * @LastEditTime: 2025-04-20 00:43:00
 * @FilePath: \yupao-frontend-master\src\services\message.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import request from "../plugins/request";

const messageApi = {
    getMessageList: "/message/list",
    getUserHistoryMessage: "/message/getUserHistoryMessage",
    getRoomHistoryMessage: "/message/getRoomHistoryMessage",
}

export function getMessageList() {
    return request({
        url: messageApi.getMessageList,
        method: 'get'
    })
}

export function getUserHistoryMessage(fromUserId: string, toUserId: string) {
    return request({
        url: messageApi.getUserHistoryMessage,
        method: 'get',
        params: {
            fromUserId: fromUserId,
            toUserId: toUserId
        }
    })
}

export function getRoomHistoryMessage(fromUserId: any, toRoomId: any) {
    return request({
        url: messageApi.getRoomHistoryMessage,
        method: 'get',
        params: {
            fromUserId: fromUserId,
            toRoomId: toRoomId
        }
    })
}
